package thread;

public class ThreadJoin {
    private volatile static int i = 0;

    public static class ThreadAdd extends Thread {
        @Override
        public void run() {
            for (; i < 1000000000; i++) ;
        }


        public static void main(String[] args) throws InterruptedException {
            ThreadAdd threadAdd = new ThreadAdd();
            threadAdd.start();
            threadAdd.join();
            System.out.println(i);
        }
    }

}
